import { mapState } from "vuex";
import { debounce } from "xe-utils";
const ExportDefault = {
    data() {
        return {
        };
    },
    mounted() {


        let ppmParams = JSON.parse(sessionStorage.getItem('ppmCondition'));
        if (this.formData["ORDER_ITEM-PRODUCT_NAME"]) {
            this.formData["ORDER_ITEM-PRODUCT_NAME"].value = ppmParams.prodName;//产品名称赋值
            this.formData["ORDER_ITEM-CUST_SO_NUMBER"].value = this.$route.query.customerOrder.custSoNumber || '';//流水号初始化
        }


        for (let key in this.formData) {
            if (key.split("-")[1] == "142002190") {
                this.formData[key].value = this.elecLabel;//电路标签默认
            }
        }

    },
    computed: {
        ...mapState("orders", ["elecLabel"]),
        ...mapState("user", ["user"]),
    },
    methods: {
        selectA() {
            let value = this.formData["PROD_INST-100010204"].value;
            if (value == 30010001) {
                //客户付费
            }
            if (value == 30010002) {
                //付费运营商
                this.formData["PROD_INST-100010096"].value = "";
                this.formData['PROD_INST-100010096'].text = "";
            }
        },

        Isshow(value, id) {//属性显示隐藏
            if (value == '1') {
                if (document.getElementById(id)) {
                    document.getElementById(id).style.display = 'block'
                }
            }
            if (value == '0') {
                if (document.getElementById(id)) {
                    document.getElementById(id).style.display = 'none'
                }
            }
        },

        // SetRequired(value, id) {//必填验证设置
        //     if (document.getElementById(id)) {
        //         let classVal = document.getElementById(id).getAttribute("class");
        //         if (value == '1') {//增加必填验证
        //             classVal = classVal.concat(" is-required")
        //             document.getElementById(id).setAttribute('class', classVal)
        //         }
        //         if (value == '0') {//去掉必填验证
        //             classVal = classVal.replace("is-required", "");
        //             document.getElementById(id).setAttribute('class', classVal)
        //         }
        //     }
        // },


        //获取input-grid选中的值
        getRowValue(val) {

        },

        //获取input-grid选中的值
        getInputGridValue(obj) {
        },

        //加载dialogInput组件上的congfig配置
        dialogInputConfig() {
            return {}
        },

        //获取插件返回的值
        getPluginValue(obj, key) {


            if (key == '100013695') {//发展人信息
                if (obj.index == '0') {//第一发展人
                    this.formData['1688-141000467'].value = obj.row.CHANNEL_NBR;//渠道编码
                    this.formData['1688-141000468'].value = obj.row.STAFF_ID;//发展人标识
                }
                if (obj.index == '1') {//第二发展人
                    this.formData['1689-141000467'].value = obj.row.CHANNEL_NBR;//渠道编码
                    this.formData['1689-141000468'].value = obj.row.STAFF_ID;//发展人标识
                }
            }
        },

        //展开收起
        ctrlfold(fold, id) {


            if (id == "10460285") {//MSTP甲乙端业务信息外框展示 
                if (fold) {  //业务信息展开收起
                    this.Isshow("1", "10461239");
                } else {
                    this.Isshow("0", "10461239");
                }
            }
            if (id == "10460167") {//资费信息展开收起

            }
        },


    },
}

export default ExportDefault;
